home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / Other Langs / MacPerl ƒ / Perl Source ƒ / MacPerl / MPAppleEvents.h < prev    next >
Text File  |  1994-01-02  |  3KB  |  99 lines

  1. /*********************************************************************
  2. Project    :    MacPerl                    -    Real Perl Application
  3. File        :    MPAppleEvents.h    -
  4. Author    :    Matthias Neeracher
  5.  
  6. A lot of this code is borrowed from 7Edit written by
  7. Apple Developer Support UK
  8.  
  9. Started    :    17Mar93                                Language    :    MPW C
  10. Modified    :    17Mar93    MN
  11.                 29May93    MN    Compiles correctly
  12.                 30May93    MN    Support Console Windows
  13.                 28Aug93    MN    IssueFormatCommand
  14. Last        :    28Aug93
  15. *********************************************************************/
  16.  
  17. #ifndef __MPAPPLEEVENTS__
  18. #define __MPAPPLEEVENTS__
  19.  
  20. #include <Types.h>
  21. #include <QuickDraw.h>
  22. #include <Packages.h>
  23. #include <GestaltEqu.h>
  24. #include <Editions.h>
  25. #include <Printing.h>
  26. #include <AppleEvents.h>
  27.  
  28. #ifndef __MPGLOBALS__
  29. #include <MPGlobals.h>
  30. #endif
  31.  
  32. enum {
  33.  
  34. ETX = 0x03, /* Enter key on keyboard or keypad */
  35. BS  = 0x08, /* Backspace key on keyboard       */
  36. HT  = 0x09, /* Tab key on keyboard             */
  37. CR  = 0x0D, /* Return key on keyboard          */
  38. ESC = 0x1B, /* Clear key on keypad             */
  39. FS  = 0x1C, /* Left arrow key on keypad        */
  40. GS  = 0x1D, /* Right arrow key on keypad       */
  41. RS  = 0x1E, /* Up arrow key on keypad          */
  42. US  = 0x1F  /* Down arrow key on keypad        */
  43. };
  44.  
  45. pascal Boolean AllSelected(TEHandle te);
  46. pascal void InitAppleEvents(void);
  47. pascal void DoAppleEvent(EventRecord theEvent);
  48.  
  49. #ifndef RUNTIME
  50. pascal OSErr MakeSelfAddress(AEAddressDesc *selfAddress);
  51. #endif
  52.  
  53. /*
  54.     Text Commands
  55. */
  56. pascal void IssueCutCommand(DPtr theDocument);
  57. pascal void IssueCopyCommand(DPtr theDocument);
  58. pascal void IssuePasteCommand(DPtr theDocument);
  59. pascal void IssueClearCommand(DPtr theDocument);
  60. pascal void IssueFormatCommand(DPtr theDocument);
  61.  
  62. /*
  63.     Window Commands
  64. */
  65.  
  66. pascal void IssueZoomCommand(WindowPtr whichWindow, short whichPart);
  67. pascal void IssueCloseCommand(WindowPtr whichWindow);
  68. pascal void IssueSizeWindow(WindowPtr whichWindow, short newHSize,short newVSize);
  69. pascal void IssueMoveWindow(WindowPtr whichWindow, Rect sizeRect);
  70. pascal void IssuePageSetupWindow(WindowPtr whichWindow, TPrint thePageSetup);
  71. pascal void IssueShowBorders(WindowPtr whichWindow, Boolean showBorders);
  72. pascal void IssuePrintWindow(WindowPtr whichWindow);
  73.  
  74. /*
  75.     Document Commands
  76. */
  77. pascal OSErr IssueAEOpenDoc(FSSpec myFSSpec);
  78. pascal void  IssueAENewWindow(void);
  79. pascal OSErr IssueSaveCommand(WindowPtr theWindow, FSSpecPtr where);
  80.  
  81. pascal OSErr IssueRevertCommand(WindowPtr theWindow);
  82. pascal OSErr IssueQuitCommand(void);
  83.  
  84. #ifndef RUNTIME
  85. pascal void IssueCreatePublisher(DPtr whichDoc);
  86. #endif
  87.  
  88. pascal void EnforceMemory(DPtr theDocument, TEHandle theHTE);
  89.  
  90. #ifndef RUNTIME
  91. /*
  92.     Recording of Keystrokes
  93. */
  94.  
  95. pascal void AddKeyToTypingBuffer(DPtr theDocument, char theKey);
  96. pascal void FlushAndRecordTypingBuffer(void);
  97. #endif
  98.  
  99. #endif